{% extends "events/base.html" %}
{% load i18n %}

{% block coltype %}colMS{% endblock %}

{% block bodyclass %}dashboard{% endblock %}

{% block breadcrumbs %}{% if not is_popup %}
<div class="breadcrumbs">
     <a href="../../">Home</a> &rsaquo;
     <a href="../">Event Manager</a> 
     
</div>
{% endif %}{% endblock %}

{% block content %}
{% if user.is_authenticated %}
	<h2>Your Events</h2>
	{% if my_approved_event_list %}
	    <ul>
	    {% for event in my_approved_event_list %}
	        <li><a href="/events/{{ event.id }}/">{{ event.Name }}</a></li>
	    {% endfor %}
	    </ul>
	{% else %}
	    <p>You have no events to view.</p>   
	{% endif %}
	     <h3>Events Under Review</h3>
	     <p style="color: red;">Red events are on hold</p>
	{% if my_review_list %}
	    <ul>
	    {% for event in my_review_list %}
	        <li><a {% if event.approval_status == 'H'%}style="color: red;"{%endif%} href="/events/{{ event.id }}/" >{{ event.Name }}</a>&nbsp;({% if event.approval_status == 'H'%}ON HOLD: {{event.approval_date|timesince}} TOTAL:{%endif%}{{event.date_created|timesince}})</li>
	    {% endfor %}
	    </ul>
	{% else %}
	    <p>You have no events to view.</p>   
	{% endif %}
{% endif %}

<h2>Upcoming Events</h2> 
{% if approved_event_list %}
    <table>
    	<tr>
    		<th>Event Name</th>
    		<th>Dates</th>
    		<th>Event Type</th>
    	</tr>
    {% for event in approved_event_list %}
        <tr>
        	<td><a href="/events/{{ event.id }}/">{{ event.Name }}</a></td>
        	<td>{{event.Start_Date}} - {{event.End_Date}}</td>
        	<td>{{ event.content_type|title }}</a></td>
        </tr>
    {% endfor %}
    </table>
{% else %}
    <p>There are no upcoming events.</p>
{% endif %}

{% endblock %}

{% block sidebar %}
<div id="content-related">
	{% if user.is_authenticated %}
		<div class="module" id="superuser-module">
			<h2> Menu </h2>
				<ul>
					<li><a href="add/" class="addlink">&nbsp;Submit Event</a></li>
					<br>
					<li><a href="/events/all/">All Events</a></li>
					<li><a href="/events/archive/">Event Archive</a></li>
					<li><a href="/events/votes/">Voting Metrics</a></li>
				</ul>
		</div>
	{% endif %}
	{% if can_vote %}
		<div class="module" id="superuser-module">
			<h2> My Action Items </h2>
				<ul>
			    {% for event in my_review_list %}
			    	{%if event not in user_voted_events and not event.approval_status == 'H'%}
			        	<li><a href="/events/{{ event.id }}/">{{ event.Name }}</a></li>
			    	{% endif %}
			    {% endfor %}
				</ul>
		</div>
	{% endif %}
	{% if user.is_staff or user.is_superuser %}
	    <div class="module" id="superuser-module">
			<h2> Superuser Menu </h2>
				Active planner email addresses:<br>
				<textarea name="PlannerEmails" COLS=25 ROWS=5>{%for email in active_planner_emails%}{%for e in email%}{{e}}; {%endfor%}{%endfor%}</textarea>
				<br>
				Upcoming Events WikiCode:<br>
				<textarea name="WikiCode" COLS=25 ROWS=5>{% if global_appsec_events %}
== Global AppSec Events ==
{| class="wikitable"
|-
! Global AppSec Events
! Date
! Location
! GCC Rep
! OWASP Introduction/Keynote{% for event in global_appsec_events %}
|-
| {{event.strWikiName}}
| {{event.Start_Date}} - {{event.End_Date}}
| {{event.Location}}
| {{event.gcc_rep}}
| {{event.intro_keynote}}{% endfor %}
|}{% endif %}
{% if regional_local_training_events %}
== Regional and Local Events ==
{| class="wikitable"
|-
! Event
! Type
! Date
! Location
! OWASP Introduction/Keynote{% for event in regional_local_training_events %}
|-
| [{{event.Website}} {{ event.Name }}]
| {{event.content_type|title}}
| {{event.Start_Date}} - {{event.End_Date}}
| {{event.Location}}
| {{event.intro_keynote}}{% endfor %}
|}{% endif %}
== Partner and Promotional Events ==
Want to get your event listed here? Be sure to work with the [[Global Conferences Committee]]
{% if partner_promo_events %}
{| class="wikitable"
|-
! Event
! Date
! Location
! OWASP Participation{% for event in partner_promo_events %}
|-
| [{{event.Website}} {{ event.Name }}]
| {{event.Start_Date}} - {{event.End_Date}}
| {{event.Location}}
| {{event.owasp_particpation}}{% endfor %}
|}{% endif %}</textarea>
 	   </div>
 	{% endif %}
</div>
{% endblock %}